package day07;

import java.util.Random;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Sword s = new Sword();
        AK47 k = new AK47();
        Lyb l = new Lyb();
        Transformer t = new Transformer();

        while (true){
            new Scanner(System.in).nextLine();
            int r = new Random().nextInt(4);
            switch (r){
                case 0:
                    t.setWeapon(s);
                    break;
                case 1:
                    t.setWeapon(k);
                    break;
                case 2:
                    t.setWeapon(l);
                    break;
                case 3:
                    t.setWeapon(new Weapon(){
                        @Override
                        public void Kill() {
                            System.out.println("捶你胸口");
                        }
                        @Override
                        public String getName() {
                            return "小拳拳";
                        }
                        @Override
                        public int getType() {
                            return Weapon.TYPE_HOT;
                        }
                    });
            }
            t.attack();
        }
    }
}
